#pragma once
#ifndef __SHADERVARIABLE_H__
#define __SHADERVARIABLE_H__

#include "Utility.h"

#include "../util/PreDeclare.h"
#include "../util/D3DCommon.h"

namespace WindGE
{
	class WIND_CORE_API ShaderVariable
	{
	public:
		ShaderVariable();
		~ShaderVariable();

		bool create(ID3D11ShaderReflectionConstantBuffer* reflCBuffer, 
					ID3D11ShaderReflectionVariable* reflVariable, void* buffData);

		inline const char*	name()		const	{ return variable_desc_.Name;			}
		inline unsigned int offset()	const	{ return variable_desc_.StartOffset;	}
		inline unsigned int size()		const	{ return variable_desc_.Size;			}

	private:
		ID3D11ShaderReflectionConstantBuffer*	reflection_cbuffer_;
		ID3D11ShaderReflectionVariable*			reflection_variable_;
		ID3D11ShaderReflectionType*				reflection_variable_type_;

		D3D11_SHADER_TYPE_DESC					varible_type_desc_;
		D3D11_SHADER_VARIABLE_DESC				variable_desc_;
	};

}//end namespace WindGE

#endif	//__SHADERVARIABLE_H__
